﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CodeCamp12
{
    public partial class LoginPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (System.Web.Security.Membership.ValidateUser(this
            //System.Web.Security.FormsAuthentication.SetAuthCookie("admin", true);
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string username = txtUsername.Text;
            string password = txtPassword.Text;

            if (System.Web.Security.Membership.ValidateUser(username, password))
            {
                FormsAuthentication.SetAuthCookie(username, chkRemmberMe.Checked);
                Response.Redirect("~/Default.aspx");
            }
        }
    }
}